Skip to content

fix(relay): preserve Claude tool-result images in Chat conversion - #436

Merged
LIghtJUNction merged 3 commits into
mainfrom
fix/claude-tool-result-media
Sep 21, 2026
Merged

LIghtJUNction merged 3 commits into
mainfrom
fix/claude-tool-result-media

Conversation

@LIghtJUNction

@LIghtJUNction LIghtJUNction commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Summary

Preserve images in Claude tool-result content when converting to Chat Completions. Text remains on the tool message; images are carried as user multimodal input rather than base64 text. Image-only results use [image] so tool content is nonempty. Unknown block types preserve the historical whole-array JSON fallback.

Media is accumulated at the source-message scope, keeping parallel replies contiguous: assistant -> tool -> tool -> user(media).

Upstream: QuantumNous/new-api#7512, merged as 4eb3b9160566dc4c1f4f0e9340de254f7febf056.

Regression coverage

String, text+image, image-only, URL image, multiple text blocks, unknown-block fallback, and parallel tool-result ordering. The change is confined to the Claude Messages -> Chat converter and its real relaykit tests.

Branch repair and verification

Verified head: 970a425.

Refreshed onto main@38fd4a3 with a normal merge commit. Comparison from the original PR base confirms neither changed file had moved on main. All other main files are retained; no force-push or disabled checks.

The actual Go/relaykit suites and independent service qualification passed on this exact head. Reviewed the converter patch and PR discussion. No production image/OAuth/billing acceptance is claimed.

Pricing, groups, model price lock, /fast, OAuth restrictions, quota/settlement, routing policy and admin assistant behavior are unchanged. No deployment or production data/configuration changes.

Copilot AI lite review requested due to automatic review settings September 21, 2026 15:53
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-09-21T16:05:52.625792Z f9de613 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Keep the reviewed two-file converter/test patch. Comparison from the PR base 3596c90 to main@38fd4a3 confirms neither file changed. Preserve current main in every other path, including prior frontend and authorization CI corrections.
@LIghtJUNction
LIghtJUNction merged commit df1f28b into main Sep 21, 2026
23 checks passed
@LIghtJUNction
LIghtJUNction deleted the fix/claude-tool-result-media branch October 10, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants